<script>
//打开应用的首页
import { ElButton } from "element-plus";
// import { Static } from "vue";
// import axios from "axios";
export default {
  components: { ElButton },
  methods: {
    login: function () {
      this.$router.push("/login");
    },
    register: function () {
      this.$router.push("/FirstPage");
    },
  }
  // async mounted() {
  //   console.log(JSON.parse(window.localStorage.getItem("user")).token)
  //   // const token_pass=await axios.post("192.168.53.106:8000/decode/token/"+ JSON.parse(window.localStorage.getItem("user")).token);
  //   const token_pass = await axios.get("192.168.53.106:8000/decode/token/?token=1")
  //   //后端校验token，通过则直接跳转Home
  //   if (
  //     token_pass.data.pass == "ture"
  //   ) {
  //     //改为Home
  //     window.localStorage.setItem("user", JSON.stringify(token_pass.data));
  //     window.location.replace("../src/pages/Home/Home.html");
  //   }
  // },
};
</script>

<template>
  <div class="nbody">
    <div class="logobox">
      <img src="../assets/logo.jpg" alt="小蛋壳" class="logo" />
    </div>
    <div id="denglu" @click="login()">
      <el-button type="primary" round class="anniu">登录</el-button>
    </div>
    <div id="zhuce" @click="register()"><el-button round class="anniu">注册</el-button></div>
  </div>
</template>
<style scoped>
.nbody {
  padding-top: 15.5%;
  margin: auto;
  width: 100%;
  height: 100vh;
  background-image: url("../assets/purebgp.png");
  background-repeat: repeat;
  background-size: 100% 100%;
  overflow: auto;
}

.logobox {
  display: flex;
  padding: 8.2% 14% 0 10%;
  margin-left: 24%;
}

.logo {
  border-radius: 10%;
  width: 71%;
}

#denglu {
  margin-top: 80%;
}

#zhuce {
  margin-top: 15%;
}

.anniu {
  width: 55%;
  height: 100%;
  margin: 0 25%;
  font-size: 18px;
  font-weight: bold;
}
</style>
